﻿<!--
Copyright © Pavel Fedarovich, 2010-2012

This file is part of AvalonWizard.
 
You may at your option receive a license to Avalon Wizard under 
either the terms of the Apache License version 2.0 or 
the GNU Lesser General Public License (LGPL) version 2.1 or any later version.
 
AvalonWizard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
You may obtain a copy of the Apache License at [http://www.apache.org/licenses/LICENSE-2.0].
You may obtain a copy of the LGPL at [http://www.gnu.org/licenses/].
-->
<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="clr-namespace:AvalonWizard" 
    xmlns:conv="clr-namespace:AvalonWizard.Converters" 
    xmlns:aero="clr-namespace:AvalonWizard.Aero">

    <conv:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <conv:BooleanInverterConvertor x:Key="BooleanInverter" />
    <conv:VisibilityMultiConverter x:Key="VisibilityMultiConverter" />

    <LinearGradientBrush x:Key="NavigationWindowNavigationButtonFillEnabled" StartPoint="0.5,0.0" EndPoint="0.5,1.0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFFFFF" Offset="0.0" />
                <GradientStop Color="#CCD4E9" Offset="0.1" />
                <GradientStop Color="#4881D2" Offset="0.47" />
                <GradientStop Color="#001A5A" Offset="0.47" />
                <GradientStop Color="#007BD6" Offset="0.70" />
                <GradientStop Color="#54DAFF" Offset="0.85" />
                <GradientStop Color="#86FFFF" Offset="0.95" />
                <GradientStop Color="#FFFFFF" Offset="1.0" />
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="NavigationWindowNavigationButtonFillHover" StartPoint="0.5,0.0" EndPoint="0.5,1.0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFFFFF" Offset="0.0" />
                <GradientStop Color="#DFEDF9" Offset="0.1" />
                <GradientStop Color="#3086E1" Offset="0.47" />
                <GradientStop Color="#003B91" Offset="0.47" />
                <GradientStop Color="#1793EF" Offset="0.70" />
                <GradientStop Color="#5AD4FF" Offset="0.85" />
                <GradientStop Color="#BDFFFF" Offset="0.95" />
                <GradientStop Color="#FFFFFF" Offset="1.0" />
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="NavigationWindowNavigationButtonFillPressed" StartPoint="0.5,0.0" EndPoint="0.5,1.0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#C0D2F5" Offset="0.0" />
                <GradientStop Color="#5E7A9C" Offset="0.47" />
                <GradientStop Color="#00062D" Offset="0.47" />
                <GradientStop Color="#005F9F" Offset="0.70" />
                <GradientStop Color="#1FA4E2" Offset="0.85" />
                <GradientStop Color="#61DAFF" Offset="0.95" />
                <GradientStop Color="#48CFFF" Offset="1.0" />
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="NavigationWindowNavigationButtonFillDisabled" StartPoint="0.5,0.0" EndPoint="0.5,1.0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFFFFF" Offset="0" />
                <GradientStop Color="#EBEEF5" Offset="0.5" />
                <GradientStop Color="#D8DDEB" Offset="0.5" />
                <GradientStop Color="#DFE2F0" Offset="1.0" />
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="NavigationWindowNavigationButtonStrokeEnabled" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#6C90C4" Offset="0" />
                <GradientStop Color="#315BB4" Offset="0.5" />
                <GradientStop Color="#002091" Offset="0.5" />
                <GradientStop Color="#08377C" Offset="1" />
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="NavigationWindowNavigationArrowStrokeEnabled" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStop Color="#8AB1FB" Offset="0" />
            <GradientStop Color="#002874" Offset="1" />
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="NavigationWindowNavigationArrowFill" StartPoint="0,0" EndPoint="0,1">
        <LinearGradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFFFFF" Offset="0.5" />
                <GradientStop Color="#EEEEEE" Offset="0.5" />
                <GradientStop Color="#B0B0B0" Offset="1" />
            </GradientStopCollection>
        </LinearGradientBrush.GradientStops>
    </LinearGradientBrush>

    <Style x:Key="NavigationWindowBackButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Focusable" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid Width="24" Height="24" Background="Transparent">
                        <Ellipse Name="Circle" StrokeThickness="1" Fill="{StaticResource NavigationWindowNavigationButtonFillEnabled}" Stroke="{StaticResource NavigationWindowNavigationButtonStrokeEnabled}" />

                        <Path Name="Arrow" VerticalAlignment="Center" HorizontalAlignment="Center" StrokeThickness="0.75" Data="M0.37,7.69 L5.74,14.20 A1.5,1.5,0,1,0,10.26,12.27 L8.42,10.42 14.90,10.39 A1.5,1.5,0,1,0,14.92,5.87 L8.44,5.90 10.31,4.03 A1.5,1.5,0,1,0,5.79,1.77 z" Stroke="{StaticResource NavigationWindowNavigationArrowStrokeEnabled}" Fill="{StaticResource NavigationWindowNavigationArrowFill}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Fill" Value="{StaticResource NavigationWindowNavigationButtonFillDisabled}" TargetName="Circle" />
                            <Setter Property="Stroke" Value="#B5BACE" TargetName="Circle" />
                            <Setter Property="Stroke" Value="#B0B5BACE" TargetName="Arrow" />
                            <Setter Property="Fill" Value="#D0FFFFFF" TargetName="Arrow" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Fill" Value="{StaticResource NavigationWindowNavigationButtonFillHover}" TargetName="Circle" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Fill" Value="{StaticResource NavigationWindowNavigationButtonFillPressed}" TargetName="Circle" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate TargetType="{x:Type aero:AeroWizardHeader}" x:Key="AeroWizardHeader_ControlTemplate">
        <Grid Background="{TemplateBinding Background}" Height="34" IsHitTestVisible="True">
            <Grid.Resources>
                <Style TargetType="TextBlock" x:Key="AeroWizardHeaderTextBlockStyle">
                    <Setter Property="HorizontalAlignment" Value="Left" />
                    <Setter Property="VerticalAlignment" Value="Center" />
                    <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.CaptionFontFamilyKey}}" />
                    <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.CaptionFontSizeKey}}" />
                    <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.CaptionFontStyleKey}}" />
                    <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.CaptionFontWeightKey}}" />
                    <Setter Property="TextDecorations" Value="{DynamicResource {x:Static SystemFonts.CaptionFontTextDecorationsKey}}" />
                    <Setter Property="Text" Value="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title, Mode=OneWay}" />
                </Style>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30" />
                <ColumnDefinition Width="26" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="5" />
            </Grid.RowDefinitions>
            <Button Grid.Column="0" Margin="1,0" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource NavigationWindowBackButtonStyle}" Command="{x:Static Member=local:WizardCommands.PreviousPage}" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:Wizard}, Path=CurrentPage.ShowBack,
                    Converter={StaticResource BooleanToVisibilityConverter}}" />
            <Image Grid.Column="1" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Icon}" />
            <Rectangle Grid.Column="2" Name="PART_BlurredRectangleGlow" 
                       HorizontalAlignment="{Binding ElementName=PART_caption, Path=HorizontalAlignment}" 
                       Margin="{Binding ElementName=PART_caption, Path=Margin}"
                       VerticalAlignment="{Binding ElementName=PART_caption, Path=VerticalAlignment}" 
                       Width="{Binding ElementName=PART_caption, Path=ActualWidth}" Fill="White" Opacity="0.5"
                       Height="{Binding ElementName=PART_caption, Path=ActualHeight}" Visibility="Collapsed" >
                <Rectangle.Effect>
                    <BlurEffect Radius="11" KernelType="Gaussian" />
                </Rectangle.Effect>
            </Rectangle>
            <Grid Grid.Column="2" Name="PART_BlurredTextGlow" Visibility="Collapsed">
                <Grid.Resources>
                    <Style TargetType="TextBlock" BasedOn="{StaticResource AeroWizardHeaderTextBlockStyle}">
                        <Setter Property="Foreground" Value="White" />
                    </Style>
                </Grid.Resources>
                <TextBlock>
                    <TextBlock.Effect>
                        <BlurEffect Radius="20" KernelType="Gaussian" />
                    </TextBlock.Effect>
                </TextBlock>
                <TextBlock>
                    <TextBlock.Effect>
                        <BlurEffect Radius="16" KernelType="Gaussian" />
                    </TextBlock.Effect>
                </TextBlock>
                <TextBlock>
                    <TextBlock.Effect>
                        <BlurEffect Radius="12" KernelType="Gaussian" />
                    </TextBlock.Effect>
                </TextBlock>
            </Grid>
            <TextBlock Grid.Column="2" Name="PART_caption" Style="{StaticResource AeroWizardHeaderTextBlockStyle}"/>
        </Grid>
        <ControlTemplate.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsCompositionEnabled" Value="true" />
                    <Condition Property="GlowStyle" Value="BlurredText" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_BlurredTextGlow" Property="Visibility" Value="Visible" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsCompositionEnabled" Value="true" />
                    <Condition Property="GlowStyle" Value="BlurredRectangle" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_BlurredRectangleGlow" Property="Visibility" Value="Visible" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsCompositionEnabled" Value="true" />
                    <Condition Property="GlowStyle" Value="GlowingText" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_caption" Property="TextBlock.BitmapEffect">
                    <Setter.Value>
                        <OuterGlowBitmapEffect GlowColor="White" GlowSize="10" Opacity="0.7" />
                    </Setter.Value>
                </Setter>
            </MultiTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
</ResourceDictionary>